var registerConfirm = document.querySelector(".save-warp>.btn");
var w160 = document.getElementsByClassName('w-160')[0];
var rightBox = document.getElementsByClassName("right-box")[0];
var rightBoxImg = rightBox.children[0];
var code = null;


registerConfirm.onclick = function () {
    //请求图形验证码验证接口
    code = w160.value;
    // console.log(code);
    // axios.get('http://api.jg.com/verifycode/checkCode?code='+code+'')
    // .then(function(res){
    //     console.log(res)
    // })
    // .catch(function(err){
    //     console.error(err); 
    // })

    $.ajax({
        url: 'http://api.jg.com/verifycode/checkCode',
        method: 'GET',
        dataType:'json',
        data: {
            code: code,
        },
        success: function (res) {
            console.log(res);
        }
    })
}


//点击更换不清晰的图片验证码
rightBox.onclick = function(){
    rightBoxImg.src = "http://api.jg.com/verifycode/getcode?"+Math.random()+""
    // console.log(rightBoxImg.src);
}